import {Row, Col, Switch} from 'antd';
import {WeaCheckbox} from 'ecCom'
import {Tooltip} from 'antd';
import {inject, observer} from "mobx-react"
import {WeaLocaleProvider} from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

@inject('blogSetting')
@observer
export default class BasicSetting extends React.Component {
  render() {
    const {blogSetting} = this.props;
    const {checked, ifAllowRequest} = blogSetting.baseStatus;
    return (
      <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@wkz8uq`} className="" style={{borderBottom: '1px solid #e9e9e9'}}>
        <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@j0nwir`} span="5" style={{textAlign: "center", height: '39px'}}>
          <div style={{lineHeight: '39px'}}>{getLabel('384478', "接收关注申请")}</div>
        </Col>
        <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@no6k29`} span="19" style={{textAlign: "left", backgroundColor: 'rgb(248,248,248)', padding: '7px 0'}}>
          {
            ifAllowRequest === 1
              ?
              <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@sqmg67`}
                display="switch"
                onChange={v => blogSetting.changeChecked(v)}
                value={checked}
                style={{"line-height":25}}
                viewAttr={ifAllowRequest === 1 ? 2 : 1}
              ></WeaCheckbox>
              :
              <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@9dbr94`} title='系统选项“允许申请关注”已关闭。无法接受新的关注申请。'>
                <span>
                     <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@mfsbj7`}
                       display="switch"
                       style={{"line-height":25}}
                       onChange={v => blogSetting.changeChecked(v)}
                       value={checked}
                       viewAttr={ifAllowRequest === 1 ? 2 : 1}
                     ></WeaCheckbox>
                </span>
              </Tooltip>
          }
        </Col>
      </Row>
    )
  }

}

